<template>
    <view>
        <!-- d:\applet\byteApplet\dy-wallpaper-applet-2\pages\talent\cooperation\cooperation.ttml -->

        <view>
            <image src="@/static/images/new/darenyaoqing.png" class="image" />
        </view>
        <view class="padding-xs flex align-center">
            <view class="flex-sub text-center">
                <view class="text-xl padding">
                    <text class="text-black text-bold myclass">我要入住{{appletName}}</text>
                </view>
                <view class="lianxifangshi">合作联系方式</view>
            </view>
        </view>

        <view>
            <view class="cu-bar margin-top fangshi">
                <text class="numberno">QQ号：{{qq}}</text>
                <text class="copy" @click.stop.prevent="copyContact" data-type="1">
                    <text class="">|</text>
                    复制
                </text>
            </view>
            <view class="cu-bar margin-top fangshi">
                <text class="numberno">微信号：{{wxaccount}}</text>
                <text class="copy" @click.stop.prevent="copyContact" data-type="2">
                    <text class="">|</text>
                    复制
                </text>
            </view>
            <view class="cu-bar margin-top fangshi">
                <text class="numberno">抖音号：{{dyaccount}}</text>
                <text class="copy" @click.stop.prevent="copyContact" data-type="3">
                    <text class="">|</text>
                    复制
                </text>
            </view>
        </view>
    </view>
</template>

<script>


const http = require('../../../utils/http.js');

export default {
    data() {
        return {
            qq: '2549789059',
            wxaccount: '2549789059',
            dyaccount: 'gyf2549789059',
			appletName:'星光壁纸'
        };
    },
    onLoad: function (options) {
		this.getContact();
	},
    methods: {
		getContact:function(){
			let that = this;
			var params = {
			  url: "/config/getContact",
			  method: "GET",
			  data: {
			  },
			  callBack: function (res) {
			    that.setData({
			      qq: res.data.qq ? res.data.qq : that.qq,
				  wxaccount : res.data.wx ? res.data.wx : that.wxaccount,
				  dyaccount:res.data.dy ? res.data.dy  : that.dyaccount,
				  appletName: res.data.appletName ? res.data.appletName : that.appletName
			    }); 
			  }
			};
			http.request(params); 
		},
        copyContact: function (e) {
            let value = '';
            let type = e.currentTarget.dataset.type;

            if (type == 1) {
                value = this.qq;
            } else {
                if (type == 2) {
                    value = this.wxaccount;
                } else {
                    if (type == 3) {
                        value = this.dyaccount;
                    }
                }
            }

            uni.setClipboardData({
                data: value,
                success: function (res) {
                    uni.showToast({
                        title: '复制成功',
                        duration: 2000,
                    
                        success(res) {},
                    
                        fail(res) {}
                    });
                }
            });
        }
    }
};
</script>
<style>
@import './cooperation.css';
</style>
